import * as http from '@api/http'

/**
 * @purpose 获取活动详情
 * @param groupStageId
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function detail (groupStageId) {
  return http
    .get('activity.detail', {
      group_stage: groupStageId
    })
    .then(r => r.data)
}

/**
 * @purpose 根据集合点获取集合点信息
 * @param groupStageId
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function collectionPointsByGroupStageId (groupStageId) {
  return http
    .get('activity.collectionPointsByGroupStageId', {
      group_stage: groupStageId
    })
    .then(r => r.data)
}

/**
 * @purpose 获取活动客服信息
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function customer () {
  return http
    .get('activity.customer')
    .then(r => r.data)
}

/**
 * @purpose 获取团期已报名人员名单
 * @param groupStageId
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function collectionPointsSignUpByGroupStageId (groupStageId) {
  return http
    .get('activity.collectionPointsSignUpByGroupStageId', {
      group_stage: groupStageId
    })
    .then(r => r.data)
}
